uniform sampler2D   texture;
uniform vec2        off;
uniform float       blurRadius;

void main()
{
    float distance = texture2D(texture, gl_TexCoord[0].xy).a;
    vec2 lerpModif = off * mix(blurRadius, 0.0, distance);
    
	vec4 sum =  texture2D(texture, gl_TexCoord[0].xy - 4.0f * lerpModif) * 0.04 +
                texture2D(texture, gl_TexCoord[0].xy - 3.0f * lerpModif) * 0.09 +
                texture2D(texture, gl_TexCoord[0].xy - 2.0f * lerpModif) * 0.12 +
                texture2D(texture, gl_TexCoord[0].xy - lerpModif)        * 0.15 +
                texture2D(texture, gl_TexCoord[0].xy)                    * 0.20 +
                texture2D(texture, gl_TexCoord[0].xy + lerpModif)        * 0.15 +
                texture2D(texture, gl_TexCoord[0].xy + 2.0f * lerpModif) * 0.12 +
                texture2D(texture, gl_TexCoord[0].xy + 3.0f * lerpModif) * 0.09 +
                texture2D(texture, gl_TexCoord[0].xy + 4.0f * lerpModif) * 0.04;
    
    gl_FragColor    = sum;
    gl_FragColor.a  = distance;
}
